package com.example.campusproject.slice;

import com.example.campusproject.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Image;

public
class MainAbilitySlice extends AbilitySlice {
    private Image iv_lt,iv_rt,iv_lb,iv_rb;
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        iv_lb= (Image) this.findComponentById(ResourceTable.Id_iv_lb);
        iv_lt= (Image) this.findComponentById(ResourceTable.Id_iv_lt);
        iv_rt= (Image) this.findComponentById(ResourceTable.Id_iv_rt);
        iv_rb= (Image) this.findComponentById(ResourceTable.Id_iv_rb);
        //学校生活
        iv_lt.setClickedListener(listener->present(new XXSHAbilitySlice(),
                new Intent()));
        //出行指南
        iv_rt.setClickedListener(listener->present(new CXZNAbilitySlice(),new Intent()));
        //游玩西科
        iv_lb.setClickedListener(listener->present(new YWNNAbilitySlice(),new Intent()));
        //号码百事通
        iv_rb.setClickedListener(listener->present(new HMBSTAbilitySlice(),new Intent()));
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
